<%-- 
    Document   : patient
    Created on : Jun 3, 2011, 7:38:03 AM
    Author     : Libin
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<script type="text/javascript">
//<![CDATA[
function initialiseInputs() {
        // Clear any old values from the inputs (that might be cached by the browser after a page reload)
        document.getElementById("sd").value = "";
}

datePickerController.addEvent(window, 'load', initialiseInputs);
//]]>
</script>

<br/>
<br/>

<logic:equal value="view" parameter="entityAction">
    <bean:define id="readOnly" value="true"/>
    </logic:equal>
<logic:notEqual value="view" parameter="entityAction">
    <bean:define id="readOnly" value="false"/>
</logic:notEqual>

<html:form action="/patientAction">
    
    <table id="cas-form-table"> 
        <caption>Patient Details</caption> 
        <colgroup>
            <col class="cas-form-table-label-column" />
            <col/>
        </colgroup>
        <thead>
            <tr>
                <th scope="col"></th>
                <th scope="col"></th>
            </tr>
        </thead>
        <tbody> 
        
            <logic:notEqual value="add" parameter="entityAction">
            <tr>  
                <td>ID</td>  
                <td><html:text property="id" readonly="true" /></td>  
            </tr>  
            </logic:notEqual>
            <tr>  
                <td>Registration Number <span style="color: red"> (*)</span></td>  
                <td>
                    <html:text property="registrationNumber" readonly="${readOnly}" />
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="registrationNumber">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>
            </tr>  
            <tr>  
                <td>First Name<span style="color: red"> (*)</span></td>  
                <td>
                    <html:text property="firstName" readonly="${readOnly}" />
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="firstName">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>
            </tr>  
            <tr>  
                <td>Second Name</td>  
                <td><html:text property="secondName" readonly="${readOnly}" /></td>
            </tr>  
            
            <tr>  
                <td>Family Name</td>  
                <td><html:text property="familyName" readonly="${readOnly}" /></td>
            </tr>  
             
            <tr>  
                <td>Tribe Name</td>  
                <td><html:text property="tribeName" readonly="${readOnly}" /></td>
            </tr>  

            <tr>  
                
                <td>Sex<span style="color: red"> (*)</span></td>  
                <td>
                    <html:radio property="sex" value="1" disabled="${readOnly}">Male</html:radio>
                    <html:radio property="sex" value="2" disabled="${readOnly}">Female</html:radio>
                </td>  
            </tr>  

            <tr>  
                <td>Date of Birth (dd/mm/yyyy)<span style="color: red"> (*)</span></td>  
                <td>
                    <logic:equal value="view" parameter="entityAction">

                        <html:text  property="dateOfBirth" readonly="${readOnly}" maxlength="10"  
                                    ></html:text>
                    </logic:equal>
                    <logic:notEqual value="view" parameter="entityAction">
                        <html:text  property="dateOfBirth" readonly="${readOnly}" maxlength="10" styleId="ed" 
                                    styleClass="w8em format-d-m-y highlight-days-67 range-high-today" ></html:text>
                    </logic:notEqual>
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="dateOfBirth">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>  
            </tr> 
            <tr >  
                                <td>Nationality<span style="color: red"> (*)</span></td>  
                <td><html:select property="nationality" disabled="${readOnly}">
                        <html:optionsCollection property="countryList" label="label" value="value" />
                    </html:select> 

                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="nationality">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>

                </td>  
            </tr> 
            <tr >  
                <td>Oman ID Card No.<span style="color: red"> (*)</span></td>  
                <td>
                    <html:text property="omanIdCardNumber" readonly="${readOnly}" />
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="omanIdCardNumber">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>  
            </tr> 
            
            <tr>  
               <td>Marital Status<span style="color: red"> (*)</span></td>  
                <td>
                    <html:radio property="maritalStatus" value="1" disabled="${readOnly}">Single</html:radio>
                    <html:radio property="maritalStatus" value="2" disabled="${readOnly}">Married</html:radio>
                </td>  
            </tr>  
            <tr>  
                <td>Passport Number</td>  
                <td>
                    <html:text property="passportNumber" readonly="${readOnly}" />
                    <logic:messagesPresent>
                        <span style="color: #f00"> 
                            <html:messages id="msg" property="passportNumber">
                                <bean:write name="msg" />
                            </html:messages>
                        </span>
                    </logic:messagesPresent>
                </td>
            </tr> 
            
            <tr>  
                <td>Address</td>  
                <td><html:text property="address" readonly="${readOnly}" /></td>
            </tr>  
            
            <tr>  
                <td>Occupation</td>  
                <td><html:text property="occupation" readonly="${readOnly}" /></td>
            </tr>  

            <tr>  
                <td>Company</td>  
                <td><html:text property="company" readonly="${readOnly}" /></td>
            </tr> 
            <tr>  
                <td>Mobile Phone</td>  
                <td><html:text property="mobilePhone" readonly="${readOnly}" /></td>
            </tr> 
            <tr>  
                <td>Office Phone</td>  
                <td><html:text property="officePhone" readonly="${readOnly}" /></td>
            </tr> 
            <tr>  
                <td>Office Phone Ext.</td>  
                <td><html:text property="officePhoneExt" readonly="${readOnly}" /></td>
            </tr> 
            <tr>  
                <td>Home Phone</td>  
                <td><html:text property="homePhone" readonly="${readOnly}" /></td>
            </tr> 
            <tr>  
                <td>Email Address</td>  
                <td><html:text property="emailAddress" readonly="${readOnly}" /></td>
            </tr>             
        </tbody>
    </table>
                
<br/>
</br>
 <table id="cas-prescription-form-table"> 
        <caption>Patient History</caption> 
        <colgroup>
            <col class="cas-prescription-form-table-label-column" />
        </colgroup>
        <thead>
            <tr>
                <th scope="col"></th>
                <th scope="col"></th>
            </tr>
        </thead>
        <tbody> 
             <tr> 
                <td>Prescription</td>  
                <td><html:textarea rows="10" cols="65" property="prescription" readonly="${readOnly}" /></td>
              </tr>        
        </tbody>
    </table>

                <html:hidden property="entityAction" />
                <html:submit value=" O K "/>
                <html:cancel value="Cancel"/>
</html:form>
<br/>
<br/>